<%--
  Created by IntelliJ IDEA.
  User: qintao30057
  Date: 2018/1/26
  Time: 9:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>编辑服务商</title>
    <%@ include file="../../common/meta.jsp" %>
    <link href="${ctx}/css/page/common-win.css?t=${now}" rel="stylesheet">
    <%@ include file="../../common/common-body.jsp" %>
    <script src="${ctx}/js/plugins/validate/jquery.validate.custom.js?t=20181024"></script>
    <script src="${ctx}/js/plugins/jquery.ajaxfileupload-2.1.js"></script>
    <script src="${ctx}/js/imageview/jquery.photo.gallery.js?t=${now}"></script>
    <script src="//gosspublic.alicdn.com/aliyun-oss-sdk.min.js"></script>
    <script src="${ctx}/js/common/ossUtil.js?t=${now}"></script>
    <script src="${ctx}/js/common/upLoadingFileSize.js?t=${now}"></script>
    <style>
        #_btnDiv{
            height: 34px;
            margin-bottom: 0px;
        }
    </style>
    <script>
        var editType = '${type}';
        var oneBizEnumInfo = ${oneBizEnumInfo};
        var searchInfo = ${searchInfo};
        var bizEnumGroupMap = ${bizEnumGroupMap};
    </script>
</head>
<body class="gray-bg">
<div>
    <div class="myContent">
        <div class="tabs-container">
            <div class="tab-content">
                <%--项目简介--%>
                <div id="tab-1" class="tab-pane active">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="ibox float-e-margins myIbox">
                                <div class="ibox-content">
                                    <h5 class="page-header page-header-new"><i class="fa fa-file-text"></i>&nbsp;&nbsp;基本信息</h5>
                                    <form class="form-horizontal m-t" id="_bizEnumDataForm">
                                        <c:choose>
                                            <c:when test="${type=='info'}">
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">组名称：</label>
                                                    <label class="col-sm-3 control-label control-label-content">${not empty oneBizEnumInfo ? oneBizEnumInfo.groupName:''}</label>
                                                    <label class="col-sm-2 control-label">排序：</label>
                                                    <label class="col-sm-3 control-label control-label-content">${not empty oneBizEnumInfo ? oneBizEnumInfo.sortNum:''}</label>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">标签类型：</label>
                                                    <label class="col-sm-3 control-label control-label-content">
                                                        <c:forEach items="${bizCodeTypeMap}" var="item">
                                                            <c:if test="${not empty oneBizEnumInfo && oneBizEnumInfo.bizCode == item.code }"  >${item.name}</c:if>
                                                        </c:forEach></label>
                                                    <label class="col-sm-2 control-label">标签名称：</label>
                                                    <label class="col-sm-3 control-label control-label-content">${not empty oneBizEnumInfo ? oneBizEnumInfo.enumName:''}</label>
                                                </div>
                                                <%--<div class="form-group">--%>
                                                    <%--<label class="col-sm-2 control-label">标签注释：</label>--%>
                                                    <%--<label class="col-sm-8 control-label control-label-content">${not empty oneBizEnumInfo ? oneBizEnumInfo.remark:''}</label>--%>
                                                <%--</div>--%>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">标签说明：</label>
                                                        <%--<label style="padding-top: 7px">--%>
                                                            <c:if test="${oneBizEnumInfo.labelState == 'plain_text'}">
                                                                <c:if test="${oneBizEnumInfo.labelState == 'plain_text'}">
                                                                    <%--<div class="form-group form-group-new">--%>
                                                                        <%--<label class="col-sm-2 control-label"></label>--%>
                                                                        <label class="col-sm-8 control-label control-label-content">
                                                                                ${not empty oneBizEnumInfo && oneBizEnumInfo.labelState == 'plain_text' ? oneBizEnumInfo.labelInstruction:''}
                                                                        </label>
                                                                    <%--</div>--%>
                                                                </c:if>
                                                            </c:if>
                                                            <c:if test="${oneBizEnumInfo.labelState == 'link'}">
                                                                    <label class="col-sm-8 control-label control-label-content">
                                                                            ${not empty oneBizEnumInfo && oneBizEnumInfo.labelState == 'link' ? oneBizEnumInfo.labelInstruction:''}
                                                                    </label>
                                                            </c:if>
                                                        <%--</label>--%>
                                                </div>
                                                <%--<c:if test="${oneBizEnumInfo.labelState == 'plain_text'}">--%>
                                                    <%--<div class="form-group form-group-new">--%>
                                                        <%--<label class="col-sm-2 control-label"></label>--%>
                                                        <%--<label class="col-sm-8 control-label control-label-content">--%>
                                                                <%--${not empty oneBizEnumInfo && oneBizEnumInfo.labelState == 'plain_text' ? oneBizEnumInfo.labelInstruction:''}--%>
                                                        <%--</label>--%>
                                                    <%--</div>--%>
                                                <%--</c:if>--%>

                                                <c:if test="${oneBizEnumInfo.labelState == 'link'}">
                                                    <div class="form-group ">
                                                        <div class="col-sm-2"></div>
                                                        <div class="col-sm-2">
                                                        <img
                                                                style="width: 100px;height: 100px"
                                                                src="${not empty oneBizEnumInfo ? oneBizEnumInfo.labelImageUrl:ctx.concat('/images/main/default.jpg')}"
                                                                alt=""/>
                                                        </div>
                                                    </div>
                                                </c:if>
                                                <%--<div id="linkDiv" class="form-group form-group-new">--%>
                                                    <%--<div class="form-group form-group-new">--%>
                                                        <%--<label class="col-sm-2 control-label"></label>--%>
                                                        <%--<div class="col-sm-8">--%>
                                                            <%--<input type="text" id="instructionUrl" name="labelInstruction"  maxlength="1000" class="form-control"  value="${not empty oneBizEnumInfo && oneBizEnumInfo.labelState == 'link' ? oneBizEnumInfo.labelInstruction:''}" />--%>
                                                            <%--<span class="help-block m-b-none tip"></span>--%>
                                                        <%--</div>--%>
                                                    <%--</div>--%>
                                                    <%--<div class="form-group">--%>
                                                        <%--<label class="col-sm-2 control-label"></label>--%>
                                                        <%--<div class="col-sm-8">--%>
                                                            <%--<div class="col-sm-2">--%>
                                                                <%--<div class="gallerys">--%>
                                                                    <%--<img style="float: left" id="imageUrl"--%>
                                                                         <%--class="img-rounded img-header gallery-pic"--%>
                                                                         <%--onclick='$.openPhotoGallery(this)'--%>
                                                                         <%--src="${not empty oneBizEnumInfo.labelImageUrl && not empty oneBizEnumInfo.labelImageUrl?oneBizEnumInfo.labelImageUrl:ctx}${not empty oneBizEnumInfo&&not empty oneBizEnumInfo.labelImageUrl ?'':'/images/main/default.jpg'}" />--%>
                                                                <%--</div>--%>
                                                            <%--</div>--%>
                                                            <%--<div class="col-sm-5">--%>
                                                                <%--<label class="btn btn-white">浏览--%>
                                                                    <%--<input type="file" id="labelImage" name="labelImage" style="left:-9999px;position:absolute;" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg" onchange="updateImageAndShow(this, 'imageUrl','labelImageUrl')" />--%>
                                                                <%--</label>--%>
                                                                <%--<input hidden="hidden" type="text" id="labelImageUrl" name="labelImageUrl"--%>
                                                                        <%--<c:if test="${type=='add'}"> required</c:if>--%>
                                                                <%--/>--%>
                                                                <%--<label style="float: left;width: 100%">图片尺寸要求：750*180px，60k以内</label>--%>
                                                            <%--</div>--%>
                                                        <%--</div>--%>
                                                    <%--</div>--%>
                                                <%--</div>--%>

                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label"><span style="color: red">*</span>图片：有效：</label>
                                                    <div class="col-sm-3">
                                                        <img
                                                            style="width: 100px;height: 100px"
                                                            src="${not empty oneBizEnumInfo ? oneBizEnumInfo.fristIconUrl:ctx.concat('/images/main/default.jpg')}"
                                                            alt=""/></div>
                                                    <label class="col-sm-2 control-label">无效：</label>
                                                    <div class="col-sm-4">
                                                        <img
                                                            style="width: 100px;height: 100px"
                                                            src="${not empty oneBizEnumInfo ? oneBizEnumInfo.secondIconUrl:ctx.concat('/images/main/default.jpg')}"
                                                            alt=""/></div>
                                                </div>
                                            </c:when>
                                            <c:otherwise>
                                                <div class="form-group form-group-new">
                                                    <label class="col-sm-2 control-label"><span style="color: red">*</span>组名称：</label>
                                                    <div class="col-sm-3">
                                                        <input type="hidden" id="id" name="id" class="form-control" value="${not empty oneBizEnumInfo ? oneBizEnumInfo.id : ''}">
                                                        <select class="form-control" name="groupCode" id="groupCode" required>
                                                            <option value="">--请选择--</option>
                                                            <c:forEach items="${bizEnumGroupMap}" var="item">
                                                                <option value="${item.code}" ${not empty oneBizEnumInfo && oneBizEnumInfo.groupCode == item.code ? 'selected' : '' } >${item.name}</option>
                                                            </c:forEach>
                                                        </select>
                                                        <span class="help-block m-b-none tip"></span>
                                                    </div>
                                                    <label class="col-sm-2 control-label">排序：</label>
                                                    <div class="col-sm-3">
                                                        <input type="text" id="sortNum" name="sortNum" class="form-control" isPInteger="true"  maxlength="20" value="${not empty oneBizEnumInfo ? oneBizEnumInfo.sortNum : ''}">
                                                        <span class="help-block m-b-none tip"></span>
                                                    </div>
                                                </div>
                                                <div class="form-group form-group-new">
                                                    <label class="col-sm-2 control-label"><span style="color: red">*</span>标签类型：</label>
                                                    <div class="col-sm-3">
                                                        <select class="form-control" name="bizCode" id="bizCode" required>
                                                            <option value="">--请选择--</option>
                                                            <c:forEach items="${bizCodeTypeMap}" var="item">
                                                                <option value="${item.code}" ${not empty oneBizEnumInfo && oneBizEnumInfo.bizCode == item.code ? 'selected' : '' } >${item.name}</option>
                                                            </c:forEach>
                                                        </select>
                                                        <span class="help-block m-b-none tip"></span>
                                                    </div>
                                                    <label class="col-sm-2 control-label"><span style="color: red">*</span>标签名称：</label>
                                                    <div class="col-sm-3">
                                                        <input type="text" id="enumName" name="enumName" class="form-control" maxlength="20" required value="${not empty oneBizEnumInfo ? oneBizEnumInfo.enumName : ''}">
                                                        <span class="help-block m-b-none tip"></span>
                                                    </div>
                                                </div>
                                                <%--<div class="form-group form-group-new">--%>
                                                    <%--<label class="col-sm-2 control-label">标签注释：</label>--%>
                                                    <%--<div class="col-sm-8">--%>
                                                        <%--<textarea id="remark" name="remark" class="form-control" maxlength="100" placeholder="100字以内" style="height: 100px; resize: none;">${not empty oneBizEnumInfo ? oneBizEnumInfo.remark : ''}</textarea>--%>
                                                        <%--<span class="help-block m-b-none tip"></span>--%>
                                                    <%--</div>--%>
                                                <%--</div>--%>
                                                <div class="form-group form-group-new">
                                                    <label class="col-sm-2 control-label">标签说明：</label>
                                                    <div class="col-sm-8">
                                                        <label style="padding-top: 7px"><input name="labelState" type="radio" value="plain_text"  <c:if test="${oneBizEnumInfo.labelState == 'plain_text'}"> checked</c:if> checked="checked"/>纯文字</label>
                                                        <label style="margin-left: 60px;padding-top: 3px"><input name="labelState" type="radio" value="link" <c:if test="${oneBizEnumInfo.labelState == 'link'}"> checked</c:if>/>链接</label>
                                                    </div>
                                                </div>
                                                <div id="textDiv" class="form-group form-group-new">
                                                    <label class="col-sm-2 control-label"></label>
                                                    <div class="col-sm-8">
                                                        <textarea type="text" id="instructionText" name="labelInstruction" placeholder="1000字以内" maxlength="1000" class="form-control">${not empty oneBizEnumInfo && oneBizEnumInfo.labelState == 'plain_text' ? oneBizEnumInfo.labelInstruction:''}</textarea>
                                                        <span class="help-block m-b-none tip"></span>
                                                    </div>
                                                </div>
                                                <div id="linkDiv" class="form-group form-group-new">
                                                    <div class="form-group form-group-new">
                                                        <label class="col-sm-2 control-label"></label>
                                                        <div class="col-sm-8">
                                                            <input type="text" id="instructionUrl" name="labelInstruction"  maxlength="1000" class="form-control"  value="${not empty oneBizEnumInfo && oneBizEnumInfo.labelState == 'link' ? oneBizEnumInfo.labelInstruction:''}" />
                                                            <span class="help-block m-b-none tip"></span>
                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <label class="col-sm-2 control-label"></label>
                                                        <div class="col-sm-8">
                                                          <div class="col-sm-2">
                                                                <div class="gallerys">
                                                                    <img style="float: left" id="imageUrl"
                                                                         class="img-rounded img-header gallery-pic"
                                                                         onclick='$.openPhotoGallery(this)'
                                                                         src="${not empty oneBizEnumInfo.labelImageUrl && not empty oneBizEnumInfo.labelImageUrl?oneBizEnumInfo.labelImageUrl:ctx}${not empty oneBizEnumInfo&&not empty oneBizEnumInfo.labelImageUrl ?'':'/images/main/default.jpg'}" />
                                                                </div>
                                                          </div>
                                                          <div class="col-sm-5">
                                                                <label class="btn btn-white">浏览
                                                                    <input type="file" id="labelImage" name="labelImage" style="left:-9999px;position:absolute;" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg" onchange="updateImageAndShow(this, 'imageUrl','labelImageUrl')" />
                                                                </label>
                                                              <input hidden="hidden" type="text" id="labelImageUrl" name="labelImageUrl"
                                                                      <c:if test="${type=='add'}"> required</c:if>
                                                              />
                                                                <label style="float: left;width: 100%">图片尺寸要求：750*180px，60k以内</label>
                                                          </div>
                                                        </div>
                                                    </div>
                                                </div>

                                            <div class="form-group form-group-new">
                                                    <label class="col-sm-2 control-label"><span style="color: red">*</span>图片：有效：</label>
                                                    <div class="col-sm-4">
                                                        <img style="float: left" id="fristIconUrlImg" name="fristIconUrlImg"  onclick='$.openPhotoGallery(this)'
                                                             src="${not empty oneBizEnumInfo.fristIconUrl ? oneBizEnumInfo.fristIconUrl:ctx.concat('/images/main/default.jpg')}"
                                                             alt="" class="img-rounded win-img gallery-pic">
                                                        <div style="position:relative">
                                                            <button type="button" style="float: left;position: absolute;top: 0px;left:100px;" class="btn btn-white" onclick="$('#fristIconUrlfile').click();">浏览</button>
                                                        <input style="float: left;visibility: hidden" type="file" id="fristIconUrlfile" name="fristIconUrlfile"  accept="image/gif,image/jpeg,image/jpg,image/png,image/svg" onchange="updateImageAndShow(this, 'fristIconUrlImg','fristIconUrl')"/>
                                                        <input style="float: left;visibility: hidden" type="text" id="fristIconUrl" name="fristIconUrl"
                                                                <c:if test="${type=='add'}"> required</c:if>
                                                        />
                                                        <span class="help-block m-b-none tip"  style="text-align: right!important;"></span>
                                                        </div>
                                                    </div>
                                                    <label class="col-sm-1 control-label">无效：</label>
                                                    <div class="col-sm-4">
                                                        <img style="float: left" id="secondIconUrlImg" name="secondIconUrlImg"  onclick='$.openPhotoGallery(this)'
                                                             src="${not empty oneBizEnumInfo.secondIconUrl ? oneBizEnumInfo.secondIconUrl:ctx.concat('/images/main/default.jpg')}"
                                                             alt="" class="img-rounded win-img gallery-pic">
                                                        <div style="position:relative">
                                                            <button type="button" style="float: left;position: absolute;top: 0px;left:100px;" class="btn btn-white" onclick="$('#secondIconUrlFile').click();">浏览</button>
                                                        <input hidden style="float: left;visibility: hidden" type="file" id="secondIconUrlFile" name="secondIconUrlFile"  accept="image/gif,image/jpeg,image/jpg,image/png,image/svg" onchange="updateImageAndShow(this, 'secondIconUrlImg','secondIconUrl')"/>
                                                            <input style="float: left;visibility: hidden" type="text" id="secondIconUrl" name="secondIconUrl"
                                                                    <c:if test="${type=='add'}"> required</c:if>
                                                            />
                                                            <span class="help-block m-b-none tip" style="text-align: right!important;">
                                                            </span></div>
                                                    </div>
                                                </div>
                                            <div class="form-group form-group-new">
                                                <label class="col-sm-10  text-center">图片尺寸要求：120*120px,60K以内</label>
                                            </div>
                                            </c:otherwise>
                                        </c:choose>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="ibox float-e-margins">
            <div class="ibox-content">
                <div class="form-group" id="_btnDiv">
                    <div class="col-sm-4 col-sm-offset-5">
                        <c:if test="${type!='info'}">
                            <input type="button" class="btn btn-primary" onclick="doBizEnumSave()" value="保存">
                        </c:if>
                        <input type="button" class="btn btn-white" onclick="doCheckDataChange()" value="返回">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${ctx}/js/bizEnum/win/editBizEnumMgr.js?t=${now}"></script>
</body>
</html>
